using System;
using System.Data.Entity.ModelConfiguration;
using System.Data.Common;
using System.Data.Entity;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using DomainLayer.Data.Entities;

namespace Infrastructure.Data.Mapping
{
	public class WaybillThirdPartyInfoMap : EntityTypeConfiguration<WaybillThirdPartyInfo>
	{
		public WaybillThirdPartyInfoMap()
		{
			// Primary Key
			this.HasKey(t => t.WaybillThirdPartyInfoId);

			// Properties
			this.Property(t => t.BoxNo)
				.IsRequired()
				.HasMaxLength(50);
				
			this.Property(t => t.BoxType)
				.HasMaxLength(50);
				
			// Table & Column Mappings
			this.ToTable("WaybillThirdPartyInfo");
			this.Property(t => t.WaybillThirdPartyInfoId).HasColumnName("WaybillThirdPartyInfoId");
			this.Property(t => t.WaybillNo).HasColumnName("WaybillNo");
			this.Property(t => t.BoxNo).HasColumnName("BoxNo");
			this.Property(t => t.BoxType).HasColumnName("BoxType");
			this.Property(t => t.Weight).HasColumnName("Weight");
			this.Property(t => t.Volume).HasColumnName("Volume");
			this.Property(t => t.IsDelete).HasColumnName("IsDelete");
			this.Property(t => t.CreateBy).HasColumnName("CreateBy");
			this.Property(t => t.CreateTime).HasColumnName("CreateTime");
			this.Property(t => t.UpdateBy).HasColumnName("UpdateBy");
			this.Property(t => t.UpdateTime).HasColumnName("UpdateTime");
		}
	}
}

